/**
 * GUI - Stamdata
 * @author Mikkel Christiansen
 */

package com.kea.firsthorse.client;

import com.google.gwt.user.client.ui.HTML;
import com.kea.firsthorse.shared.Horse;

public class GUI_Stamdata extends GUI_Master {

	public GUI_Stamdata(Horse horse) {
		super();

		add(new HTML("<h1>Stamdata</h1>"));

		add(new HTML("<hr><b>Navn: </b>" + horse.getHorse_name() + "<br>"));
		add(new HTML("<b>Fødselsdato: </b>" + horse.getBdate() + "<br>"));
		add(new HTML("<b>Køn: </b>" + horse.getKoen() + "<br>"));
		add(new HTML("<b>Kategori: </b>" + horse.getRace() + "<br>"));
		add(new HTML("<b>Stambogsnr.: </b>" + horse.getStambogsnr() + "<br>"));
		add(new HTML("<b>Øremærke / Chip nr.: </b>" + horse.getOeremaerkechip()
				+ "<br>"));

		add(new HTML("<hr><b>Ridning: </b>" + intToJaNej(horse.getRidning())
				+ "<br>"));
		add(new HTML("<b>Trav / Galop: </b>" + intToJaNej(horse.getTravGalop())
				+ "<br>"));
		add(new HTML("<b>Opdræt: </b>" + intToJaNej(horse.getOpdraet())
				+ "<br>"));
		add(new HTML("<b>Kørsel: </b>" + intToJaNej(horse.getKoersel())
				+ "<br>"));
		add(new HTML("<b>Andet: </b>" + intToJaNej(horse.getAndet())
				+ "<br><hr>"));

	}

	/**
	 * Returns "Yes" or "No" based on integer. 0 returns "No", else "Yes".
	 * 
	 */
	private String intToJaNej(int i) {
		if (i == 0) {
			return "Nej";
		} else {
			return "Ja";
		}
	}

}
